package org.hoyi.dispatchfact;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.hoyi.DB.conf.HOYIConf;
import org.hoyi.DB.ctrl.Console;
import org.hoyi.wb.comment.RequestType;

public class WELCOMEDispatcher implements IDispatcher {

	@Override
	public boolean doSth(HttpServletRequest _request, HttpServletResponse _response, String _requrl,
			RequestType _reqType) {
		
		// 如果请求的路径等于根路径，就跳转到跟路径+index.hoyip内.
		
		Console.Info("requrl:" + _requrl);
		if (_requrl == null || _requrl.equals("") || _requrl.equals("/")) {
			_requrl = "/index" + HOYIConf.Suffix;
			IDispatcher dispatchs = new HoyiPageDispatcher();
			return dispatchs.doSth(_request, _response, _requrl, _reqType);
		}else{
			return false;
		}
	}

}
